<div id="title"><?php echo $title ?></div>

<?php 
    $form_attributes = array('onsubmit' => "return form_validate()");
    $hidden = array('city_id' => $city_row['city_id']);
    echo form_open('admin/edit/cities/', $form_attributes, $hidden);  
?>
    <table border="0" id="addTable">
        <tr>
            <td>
                <label for="name">Name:</label>
            </td>
            <td>
                <input  type="text" name="name" id="name" value="<?php echo $city_row['name'] ?>" />  <span class="validationInfo"><?php echo strip_tags(form_error('name')); ?></span><br /> 
            </td>
         </tr>    
        <tr>
            <td>         
                <label for="zip">Zip:</label> 
            </td>
            <td>
                <input type="text" name="zip" id="zip" value="<?php echo  $city_row['zip'] ?>" /> <span class="validationInfo"><?php echo strip_tags(form_error('zip')); ?></span><br />
            </td>
         </tr>    
        <tr>
            <td>           
                <label for="lng">Lng:</label>
            </td>
            <td>        
                <input type="text" name="lng"  id="lng" value="<?php echo $city_row['lng'] ?>" />  <span class="validationInfo"><?php echo strip_tags(form_error('lng')); ?></span><br />
            </td>
         </tr>    
        <tr>
            <td>           
                <label for="lat">Lat:</label> 
            </td>
            <td>         
                <input type="text" name="lat" id="lat" value="<?php echo $city_row['lat'] ?>" /> <span class="validationInfo"><?php echo strip_tags(form_error('lat')); ?></span><br />
            </td>
         </tr>    
        <tr>
            <td>           
                <label for="is_active">Is Active:</label> 
            </td>
            <td>        
                <input type="checkbox" name="is_active" <?php if($city_row['is_active'] == 1) echo 'checked="checked"'; ?> /><br />
            </td>
         </tr>    
        <tr>
            <td colspan="2" align="right" style="height: 50px">   	
                <input type="submit" name="submit" value="Create new city" />         
            </td>
         </tr>
    </table>
</form>

<script type="text/javascript"><!--

    filds_for_check = new Array();
    filds_for_check['name'] = 'text';
    filds_for_check['zip'] = 'text';
    filds_for_check['lng'] = 'decimal';
    filds_for_check['lat'] = 'decimal';

    function form_validate()
    {
        return  validate_form(filds_for_check);                
    }
    
    
   
   
--></script>